
<?php

include 'bcrud/loginw.php';
include 'bcrud/filtro.php';
$filtro=new filtro();
if (isset($_POST["grabar"]) and $_POST["grabar"]=="si")
{
	//print_r($_POST);
//        $okuser=$filtro->filtro_alphanumerico($_POST["login"]);
//        $okuser=$filtro->filtro_numero($_POST["login"]);
//        $okpass=$filtro->filtro_alphanumerico($_POST["password"]);
//        if($okuser!=true || $okpass!= true){
//            echo "<script type='text/javascript'>
//                                alert('Ingrese el tipo correcto de datos');
//                                window.location='index.php';
//                                </script>"; 
//            exit();
//            
//        }else{
//             
//            $loginw=new loginw();
//            $loginw->logueo();
//            exit();
//        }
        if(preg_match("/^[0-9]+$/", $_POST["login"]) AND preg_match("/^[0-9a-zA-Z]+$/", $_POST["password"])){
             $loginw=new loginw();
             $loginw->logueo();
             exit();
            
        }else{
            echo "<script type='text/javascript'>
                                alert('Ingrese el tipo correcto de datos');
                                window.location='index.php';
                                </script>"; 
            exit();
        }
	
 }

?>


<!DOCTYPE html>
<!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html lang="en"> <!--<![endif]-->
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <script language="javascript" type="text/javascript" src="js/blogin/md5.js"></script>
  <script language="javascript" type="text/javascript" src="js/blogin/bformoperation.js"></script>
  <title>Clix Info-Login Form</title>
  <link rel="stylesheet" href="css/style.css">
  <!--[if lt IE 9]><script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
</head>
<body onload="limpiar_logueo();">
    <form  name="form" class="login" action="index.php" method="POST">
    <p>
      <label for="login">Codigo:</label>
      <input type="text" name="login" id="login">
    </p>

    <p>
      <label for="password">Password:</label>
      <input type="password" name="password" id="password">
    </p>

    <p class="login-submit">
        <button type="button"  class="login-button" title="Login" onclick="validar_logueo();">Login</button>
    </p>
    <!--<p class="forgot-password"><a href="index.html">Olvidaste tu password?</a></p>-->
    <input type="hidden" name="grabar" value="si" />
  </form>

  
</body>
</html>
